<!--
 * @Author: 星孑
 * @Date: 2022-03-23 10:49:02
 * @LastEditors: 星孑
 * @LastEditTime: 2022-04-09 15:25:26
 * @FilePath: /admin/src/components/Table/components/TdSwitch.vue
 * @Description: 表格开关组件
-->
<template>
  <el-switch
    v-model="row[col.prop]"
    active-color="#1E90FF"
    inactive-color="#cccccc"
    :active-value="1"
    :disabled="col.disabled ? col.disabled() : false"
    :inactive-value="0"
    @change="
      $emit('clickBtn', row, { name: col.type, prop: col.prop })
    "
  />
</template>

<script>
export default {
  name: 'TdSwitch',
  components: {},
  props: {
    col: {
      type: Object,
      default: () => {}
    },
    row: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {

    }
  },
  methods: {

  }
}
</script>

<style lang='scss' scoped>

</style>
